import ui
import db_utils

if __name__ == "__main__":
    # 数据库配置
    db_config = {
        'host': 'localhost',
        'database': 'bank system',
        'user': 'root',
        'password': 'Dsl20050828$'
    }

    db_connection = db_utils.connect_to_db(db_config)

    if db_connection:
        app = ui.BankSystem(db_connection)
        app.mainloop()
    else:
        print("无法连接到数据库，程序无法启动！")